int search(vector<int> &nums, int target)
{
    int index;
    for (int i = 0; i < nums.size(); i++)
    {
        if (nums[i] == target)
        {
            index = i;
            break;
        }
        else
            index = -1;
    }
    return index;
}